#include "EnemyDie.h"
#include "Sprite.h"
#include "RSManager.h"
#include "Box.h"


EnemyDie::~EnemyDie(void)
{
}

void EnemyDie::init()
{	
	_sprite = RSManager::getInstance()->getSprite(EFFECT_EXPLODE2);
	delay = 0;
	steps = 0;
}

void EnemyDie::update()
{
	delay += GAME_TIME;
	if(delay > 150 && _isAlive)
	{
		delay = 0;
		steps++;
		_sprite->Next();
	}
	if(steps >= 2)
	{
		_isAlive = false;
	}
}

void EnemyDie::render()
{
	_sprite->Render(_box->_position);
}

EnemyDie::EnemyDie(Box* box) : Object(box,ObjEffect)
{

}

Box* EnemyDie::getCollisionBox()
{
	return NULL;
}
